package xyz.thoughtset.viewer.common.api.result;

public enum ResultEnum {
    SUCCESS(0, "接口调用成功"),
    FAILED(-1, "接口调用失败"),
    VALIDATE_FAILED(-2, "参数校验失败"),
    COMMON_FAILED(-3, "接口调用失败"),
    NOTLOGIN(401, "未登录");

    private Integer status;
    private String message;

    private ResultEnum(Integer status, String message){
		this.status = status;
  	    this.message=message;
  	}
    
	Integer getStatus(){return status;}
	String getMessage(){return message;}
	
	public static String getVal(String index){
		for (ResultEnum ele : ResultEnum.values()) {
			if(ele.getStatus().equals(index)){
				return ele.getMessage();
			}
		}
		return index;
	}


}